#pragma once
#include <exception>
class NCException :public std::exception
{
public:
	NCException(int errNo, string strInfo, string strFileName, string strFuncName, int m_iLine);
	NCException(int errNo, QString strInfo, QString strFileName, QString strFuncName, int m_iLine);
	~NCException();
	int GetErrNo()
	{
		return m_errNo;
	}
	void ShowInfo(int idWindow = 0);
	QString GetInfo();
	void raise() const { throw *this; }
private:
	int m_errNo;
	QString m_strExceptInfo;
	QString m_strFileName;
	QString m_strFuncName;
	int m_iLine;
};

#define NC_THROW_ERROR(errNo, info, fileName, funcName, errorLine)		\
do																	\
{																	\
	NCException strInfo(errNo, info, fileName, funcName, errorLine);		\
	strInfo.GetInfo();												\
	strInfo.raise();												\
}while(false);				
